package com.corecloud.tools;

import lombok.Data;

/**
 * ajax请求返回数据模板
 */
@Data
public class AjaxResultData {

	//状态码
	private Integer code;
	//信息
	private String msg;
	//带回数据
	private Object data;
	//数据总条数
	private Integer count;
	//每页数据条数
	private Integer limit;
	//起始页
	private Integer curr;

	public AjaxResultData() {
	}

	public AjaxResultData(Integer code, String msg, Object data,Integer count) {
		this.code = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}


	public AjaxResultData(Object data,Integer count) {
		this.code = 0;
		this.msg = "";
		this.data = data;
		this.count = count;
	}

	public AjaxResultData(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public AjaxResultData(String msg) {
		this.code = 200;
		this.msg = msg;
	}
}
